package org.tczs93.commonreadwrite.controller;

import com.alibaba.fastjson.JSONArray;
import com.fasterxml.jackson.databind.util.JSONPObject;
import com.mysql.cj.xdevapi.JsonArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.tczs93.commonreadwrite.model.Order;
import org.tczs93.commonreadwrite.model.User;
import org.tczs93.commonreadwrite.service.UserService;

import java.util.List;

/**
 * @author ：tao.li
 * @description：
 * @date ：Created in 2021/8/23 16:36
 */
@RestController
public class TestController {

    @Autowired
    private UserService userService;

    @RequestMapping("/user/findAll")
    @ResponseBody
    public List<User> getUser(){
        List<User> user = userService.getUser();
        return user;
    }

    @RequestMapping("/user/add")
    @ResponseBody
    public Long add(){
        return userService.add();
    }

    @RequestMapping("/user/mix")
    @ResponseBody
    public List<User> mix(){
        return userService.mix();
    }

    @RequestMapping("/user/noTran")
    @ResponseBody
    public List<User> noTran(){
        return userService.noTran();
    }

    @RequestMapping("/user/tran")
    @ResponseBody
    public List<User> tran(){
        return userService.tran();
    }

    @RequestMapping("/user/miaosha")
    @ResponseBody
    public Order miaosha(){
        return userService.miaosha();
    }
}
